	.file	1 "tp0.c"
	.section .mdebug.abi32
	.previous
	.abicalls
	.globl	iflag
	.globl	iflag
	.section	.bss
	.align	2
	.type	iflag, @object
	.size	iflag, 4
iflag:
	.space	4
	.globl	buffer
	.globl	buffer
	.align	2
	.type	buffer, @object
	.size	buffer, 4
buffer:
	.space	4
	.globl	buffer_alloc_size
	.data
	.align	2
	.type	buffer_alloc_size, @object
	.size	buffer_alloc_size, 4
buffer_alloc_size:
	.word	10
	.globl	buffer_used_size
	.globl	buffer_used_size
	.section	.bss
	.align	2
	.type	buffer_used_size, @object
	.size	buffer_used_size, 4
buffer_used_size:
	.space	4
	.rdata
	.align	2
$LC0:
	.ascii	"Usage: tp0 [-hV] [file1] [file2] ... [fileN]\n\000"
	.text
	.align	2
	.globl	print_help
	.ent	print_help
print_help:
	.frame	$fp,40,$31		# vars= 0, regs= 3/0, args= 16, extra= 8
	.mask	0xd0000000,-8
	.fmask	0x00000000,0
	.set	noreorder
	.cpload	$25
	.set	reorder
	subu	$sp,$sp,40
	.cprestore 16
	sw	$31,32($sp)
	sw	$fp,28($sp)
	sw	$28,24($sp)
	move	$fp,$sp
	la	$4,__sF+88
	la	$5,$LC0
	la	$25,fprintf
	jal	$31,$25
	move	$sp,$fp
	lw	$31,32($sp)
	lw	$fp,28($sp)
	addu	$sp,$sp,40
	j	$31
	.end	print_help
	.size	print_help, .-print_help
	.rdata
	.align	2
$LC1:
	.ascii	"Version: tp0 Version 1.0 Build 15.09.2013\n\000"
	.text
	.align	2
	.globl	print_version
	.ent	print_version
print_version:
	.frame	$fp,40,$31		# vars= 0, regs= 3/0, args= 16, extra= 8
	.mask	0xd0000000,-8
	.fmask	0x00000000,0
	.set	noreorder
	.cpload	$25
	.set	reorder
	subu	$sp,$sp,40
	.cprestore 16
	sw	$31,32($sp)
	sw	$fp,28($sp)
	sw	$28,24($sp)
	move	$fp,$sp
	la	$4,__sF+88
	la	$5,$LC1
	la	$25,fprintf
	jal	$31,$25
	move	$sp,$fp
	lw	$31,32($sp)
	lw	$fp,28($sp)
	addu	$sp,$sp,40
	j	$31
	.end	print_version
	.size	print_version, .-print_version
	.rdata
	.align	2
$LC2:
	.ascii	"Invalid Option\n\000"
	.text
	.align	2
	.globl	print_invalid_opt
	.ent	print_invalid_opt
print_invalid_opt:
	.frame	$fp,40,$31		# vars= 0, regs= 3/0, args= 16, extra= 8
	.mask	0xd0000000,-8
	.fmask	0x00000000,0
	.set	noreorder
	.cpload	$25
	.set	reorder
	subu	$sp,$sp,40
	.cprestore 16
	sw	$31,32($sp)
	sw	$fp,28($sp)
	sw	$28,24($sp)
	move	$fp,$sp
	la	$4,__sF+176
	la	$5,$LC2
	la	$25,fprintf
	jal	$31,$25
	move	$sp,$fp
	lw	$31,32($sp)
	lw	$fp,28($sp)
	addu	$sp,$sp,40
	j	$31
	.end	print_invalid_opt
	.size	print_invalid_opt, .-print_invalid_opt
	.rdata
	.align	2
$LC3:
	.ascii	"hV\000"
	.text
	.align	2
	.globl	parse_args
	.ent	parse_args
parse_args:
	.frame	$fp,48,$31		# vars= 8, regs= 3/0, args= 16, extra= 8
	.mask	0xd0000000,-8
	.fmask	0x00000000,0
	.set	noreorder
	.cpload	$25
	.set	reorder
	subu	$sp,$sp,48
	.cprestore 16
	sw	$31,40($sp)
	sw	$fp,36($sp)
	sw	$28,32($sp)
	move	$fp,$sp
	sw	$4,48($fp)
	sw	$5,52($fp)
	lw	$3,48($fp)
	li	$2,1			# 0x1
	bne	$3,$2,$L21
	li	$2,2			# 0x2
	sw	$2,24($fp)
	b	$L22
$L21:
	li	$2,3			# 0x3
	sw	$2,24($fp)
$L23:
	lw	$4,48($fp)
	lw	$5,52($fp)
	la	$6,$LC3
	la	$25,getopt
	jal	$31,$25
	sw	$2,opt
	lw	$3,opt
	li	$2,-1			# 0xffffffffffffffff
	bne	$3,$2,$L25
	b	$L22
$L25:
	lw	$2,opt
	sw	$2,28($fp)
	li	$2,86			# 0x56
	lw	$3,28($fp)
	beq	$3,$2,$L28
	li	$2,104			# 0x68
	lw	$3,28($fp)
	beq	$3,$2,$L27
	b	$L29
$L27:
	sw	$0,24($fp)
	b	$L23
$L28:
	li	$2,1			# 0x1
	sw	$2,24($fp)
	b	$L23
$L29:
	li	$2,4			# 0x4
	sw	$2,24($fp)
	b	$L23
$L22:
	lw	$2,24($fp)
	move	$sp,$fp
	lw	$31,40($sp)
	lw	$fp,36($sp)
	addu	$sp,$sp,48
	j	$31
	.end	parse_args
	.size	parse_args, .-parse_args
	.rdata
	.align	2
$LC4:
	.ascii	"%s\n\000"
	.align	2
$LC5:
	.ascii	"We are sorry, but the input file could not be opened.\000"
	.text
	.align	2
	.globl	main
	.ent	main
main:
	.frame	$fp,56,$31		# vars= 16, regs= 3/0, args= 16, extra= 8
	.mask	0xd0000000,-8
	.fmask	0x00000000,0
	.set	noreorder
	.cpload	$25
	.set	reorder
	subu	$sp,$sp,56
	.cprestore 16
	sw	$31,48($sp)
	sw	$fp,44($sp)
	sw	$28,40($sp)
	move	$fp,$sp
	sw	$4,56($fp)
	sw	$5,60($fp)
	li	$2,1			# 0x1
	sw	$2,24($fp)
	lw	$4,56($fp)
	lw	$5,60($fp)
	la	$25,parse_args
	jal	$31,$25
	sw	$2,28($fp)
	la	$25,init_buffer
	jal	$31,$25
	bne	$2,$0,$L32
	la	$4,__sF+176
	la	$5,$LC4
	la	$6,$LC5
	la	$25,fprintf
	jal	$31,$25
	li	$2,1			# 0x1
	sw	$2,32($fp)
	b	$L31
$L32:
	lw	$3,28($fp)
	sw	$3,36($fp)
	li	$2,1			# 0x1
	lw	$3,36($fp)
	beq	$3,$2,$L37
	lw	$3,36($fp)
	sltu	$2,$3,1
	bne	$2,$0,$L36
	li	$2,2			# 0x2
	lw	$3,36($fp)
	beq	$3,$2,$L34
	li	$2,3			# 0x3
	lw	$3,36($fp)
	beq	$3,$2,$L35
	b	$L38
$L34:
	la	$25,stdin_inverter
	jal	$31,$25
	sw	$2,24($fp)
	b	$L33
$L35:
	lw	$2,60($fp)
	addu	$3,$2,4
	lw	$2,56($fp)
	addu	$2,$2,-1
	move	$4,$3
	move	$5,$2
	la	$25,file_inverter
	jal	$31,$25
	sw	$2,24($fp)
	b	$L33
$L36:
	la	$25,print_help
	jal	$31,$25
	b	$L33
$L37:
	la	$25,print_version
	jal	$31,$25
	b	$L33
$L38:
	la	$25,print_invalid_opt
	jal	$31,$25
$L33:
	lw	$2,24($fp)
	bne	$2,$0,$L40
	la	$4,__sF+176
	la	$5,$LC4
	la	$6,$LC5
	la	$25,fprintf
	jal	$31,$25
	li	$2,1			# 0x1
	sw	$2,32($fp)
	b	$L31
$L40:
	lw	$2,buffer
	beq	$2,$0,$L41
	lw	$4,buffer
	la	$25,free
	jal	$31,$25
$L41:
	sw	$0,32($fp)
$L31:
	lw	$2,32($fp)
	move	$sp,$fp
	lw	$31,48($sp)
	lw	$fp,44($sp)
	addu	$sp,$sp,56
	j	$31
	.end	main
	.size	main, .-main
	.align	2
	.globl	invert_line
	.ent	invert_line
invert_line:
	.frame	$fp,24,$31		# vars= 8, regs= 2/0, args= 0, extra= 8
	.mask	0x50000000,-4
	.fmask	0x00000000,0
	.set	noreorder
	.cpload	$25
	.set	reorder
	subu	$sp,$sp,24
	.cprestore 0
	sw	$fp,20($sp)
	sw	$28,16($sp)
	move	$fp,$sp
	sw	$4,24($fp)
	sw	$5,28($fp)
	sw	$0,12($fp)
$L43:
	lw	$2,28($fp)
	srl	$3,$2,1
	lw	$2,12($fp)
	sltu	$2,$2,$3
	bne	$2,$0,$L46
	b	$L42
$L46:
	lw	$3,24($fp)
	lw	$2,12($fp)
	addu	$2,$3,$2
	lbu	$2,0($2)
	sb	$2,8($fp)
	lw	$3,24($fp)
	lw	$2,12($fp)
	addu	$4,$3,$2
	lw	$3,28($fp)
	lw	$2,12($fp)
	subu	$3,$3,$2
	lw	$2,24($fp)
	addu	$2,$3,$2
	addu	$2,$2,-1
	lbu	$2,0($2)
	sb	$2,0($4)
	lw	$3,28($fp)
	lw	$2,12($fp)
	subu	$3,$3,$2
	lw	$2,24($fp)
	addu	$2,$3,$2
	addu	$3,$2,-1
	lbu	$2,8($fp)
	sb	$2,0($3)
	lw	$2,12($fp)
	addu	$2,$2,1
	sw	$2,12($fp)
	b	$L43
$L42:
	move	$sp,$fp
	lw	$fp,20($sp)
	addu	$sp,$sp,24
	j	$31
	.end	invert_line
	.size	invert_line, .-invert_line
	.align	2
	.globl	init_buffer
	.ent	init_buffer
init_buffer:
	.frame	$fp,48,$31		# vars= 8, regs= 3/0, args= 16, extra= 8
	.mask	0xd0000000,-8
	.fmask	0x00000000,0
	.set	noreorder
	.cpload	$25
	.set	reorder
	subu	$sp,$sp,48
	.cprestore 16
	sw	$31,40($sp)
	sw	$fp,36($sp)
	sw	$28,32($sp)
	move	$fp,$sp
	lw	$2,buffer
	bne	$2,$0,$L48
	li	$4,10			# 0xa
	la	$25,malloc
	jal	$31,$25
	sw	$2,buffer
	lw	$2,buffer
	bne	$2,$0,$L48
	sw	$0,24($fp)
	b	$L47
$L48:
	li	$2,1			# 0x1
	sw	$2,24($fp)
$L47:
	lw	$2,24($fp)
	move	$sp,$fp
	lw	$31,40($sp)
	lw	$fp,36($sp)
	addu	$sp,$sp,48
	j	$31
	.end	init_buffer
	.size	init_buffer, .-init_buffer
	.align	2
	.globl	grow_buffer
	.ent	grow_buffer
grow_buffer:
	.frame	$fp,48,$31		# vars= 8, regs= 3/0, args= 16, extra= 8
	.mask	0xd0000000,-8
	.fmask	0x00000000,0
	.set	noreorder
	.cpload	$25
	.set	reorder
	subu	$sp,$sp,48
	.cprestore 16
	sw	$31,40($sp)
	sw	$fp,36($sp)
	sw	$28,32($sp)
	move	$fp,$sp
	lw	$2,buffer_alloc_size
	sll	$2,$2,1
	lw	$4,buffer
	move	$5,$2
	la	$25,realloc
	jal	$31,$25
	sw	$2,24($fp)
	lw	$2,24($fp)
	bne	$2,$0,$L51
	lw	$4,buffer
	la	$25,free
	jal	$31,$25
	sw	$0,28($fp)
	b	$L50
$L51:
	lw	$2,24($fp)
	sw	$2,buffer
	lw	$2,buffer_alloc_size
	sll	$2,$2,1
	sw	$2,buffer_alloc_size
	li	$2,1			# 0x1
	sw	$2,28($fp)
$L50:
	lw	$2,28($fp)
	move	$sp,$fp
	lw	$31,40($sp)
	lw	$fp,36($sp)
	addu	$sp,$sp,48
	j	$31
	.end	grow_buffer
	.size	grow_buffer, .-grow_buffer
	.rdata
	.align	2
$LC6:
	.ascii	"\n\000"
	.text
	.align	2
	.globl	invert_file
	.ent	invert_file
invert_file:
	.frame	$fp,56,$31		# vars= 16, regs= 3/0, args= 16, extra= 8
	.mask	0xd0000000,-8
	.fmask	0x00000000,0
	.set	noreorder
	.cpload	$25
	.set	reorder
	subu	$sp,$sp,56
	.cprestore 16
	sw	$31,48($sp)
	sw	$fp,44($sp)
	sw	$28,40($sp)
	move	$fp,$sp
	sw	$4,56($fp)
$L53:
	lw	$3,56($fp)
	lw	$2,56($fp)
	lw	$2,4($2)
	addu	$2,$2,-1
	sw	$2,4($3)
	bgez	$2,$L56
	lw	$4,56($fp)
	la	$25,__srget
	jal	$31,$25
	sw	$2,32($fp)
	b	$L57
$L56:
	lw	$2,56($fp)
	lw	$3,0($2)
	move	$4,$3
	lbu	$4,0($4)
	sw	$4,32($fp)
	addu	$3,$3,1
	sw	$3,0($2)
$L57:
	lw	$3,32($fp)
	sw	$3,24($fp)
	li	$2,-1			# 0xffffffffffffffff
	bne	$3,$2,$L55
	b	$L54
$L55:
	lw	$2,buffer_alloc_size
	addu	$3,$2,-1
	lw	$2,buffer_used_size
	bne	$2,$3,$L58
	la	$25,grow_buffer
	jal	$31,$25
	move	$3,$2
	li	$2,1			# 0x1
	beq	$3,$2,$L58
	sw	$0,28($fp)
	b	$L52
$L58:
	lb	$3,24($fp)
	li	$2,10			# 0xa
	bne	$3,$2,$L60
	lw	$2,buffer_used_size
	beq	$2,$0,$L61
	lw	$4,buffer
	lw	$5,buffer_used_size
	la	$25,invert_line
	jal	$31,$25
	lw	$3,buffer
	lw	$2,buffer_used_size
	addu	$3,$3,$2
	li	$2,10			# 0xa
	sb	$2,0($3)
	lw	$2,buffer_used_size
	addu	$2,$2,1
	li	$4,1			# 0x1
	lw	$5,buffer
	move	$6,$2
	la	$25,write
	jal	$31,$25
	sw	$0,buffer_used_size
	b	$L53
$L61:
	li	$4,1			# 0x1
	la	$5,$LC6
	li	$6,1			# 0x1
	la	$25,write
	jal	$31,$25
	b	$L53
$L60:
	la	$5,buffer_used_size
	lw	$3,0($5)
	move	$4,$3
	lw	$2,buffer
	addu	$4,$4,$2
	lbu	$2,24($fp)
	sb	$2,0($4)
	addu	$3,$3,1
	sw	$3,0($5)
	b	$L53
$L54:
	lw	$2,buffer_used_size
	beq	$2,$0,$L64
	lw	$4,buffer
	lw	$5,buffer_used_size
	la	$25,invert_line
	jal	$31,$25
	li	$4,1			# 0x1
	lw	$5,buffer
	lw	$6,buffer_used_size
	la	$25,write
	jal	$31,$25
$L64:
	li	$2,1			# 0x1
	sw	$2,28($fp)
$L52:
	lw	$2,28($fp)
	move	$sp,$fp
	lw	$31,48($sp)
	lw	$fp,44($sp)
	addu	$sp,$sp,56
	j	$31
	.end	invert_file
	.size	invert_file, .-invert_file
	.rdata
	.align	2
$LC7:
	.ascii	"r\000"
	.text
	.align	2
	.globl	file_inverter
	.ent	file_inverter
file_inverter:
	.frame	$fp,56,$31		# vars= 16, regs= 3/0, args= 16, extra= 8
	.mask	0xd0000000,-8
	.fmask	0x00000000,0
	.set	noreorder
	.cpload	$25
	.set	reorder
	subu	$sp,$sp,56
	.cprestore 16
	sw	$31,48($sp)
	sw	$fp,44($sp)
	sw	$28,40($sp)
	move	$fp,$sp
	sw	$4,56($fp)
	sw	$5,60($fp)
	sw	$0,28($fp)
$L66:
	lw	$2,28($fp)
	lw	$3,60($fp)
	sltu	$2,$2,$3
	bne	$2,$0,$L69
	b	$L67
$L69:
	lw	$2,28($fp)
	sll	$3,$2,2
	lw	$2,56($fp)
	addu	$2,$3,$2
	lw	$4,0($2)
	la	$5,$LC7
	la	$25,fopen
	jal	$31,$25
	sw	$2,24($fp)
	lw	$2,24($fp)
	bne	$2,$0,$L70
	sw	$0,32($fp)
	b	$L65
$L70:
	lw	$4,24($fp)
	la	$25,invert_file
	jal	$31,$25
	move	$3,$2
	li	$2,1			# 0x1
	beq	$3,$2,$L71
	sw	$0,32($fp)
	b	$L65
$L71:
	lw	$4,24($fp)
	la	$25,fclose
	jal	$31,$25
	lw	$2,28($fp)
	addu	$2,$2,1
	sw	$2,28($fp)
	b	$L66
$L67:
	li	$2,1			# 0x1
	sw	$2,32($fp)
$L65:
	lw	$2,32($fp)
	move	$sp,$fp
	lw	$31,48($sp)
	lw	$fp,44($sp)
	addu	$sp,$sp,56
	j	$31
	.end	file_inverter
	.size	file_inverter, .-file_inverter
	.align	2
	.globl	stdin_inverter
	.ent	stdin_inverter
stdin_inverter:
	.frame	$fp,40,$31		# vars= 0, regs= 3/0, args= 16, extra= 8
	.mask	0xd0000000,-8
	.fmask	0x00000000,0
	.set	noreorder
	.cpload	$25
	.set	reorder
	subu	$sp,$sp,40
	.cprestore 16
	sw	$31,32($sp)
	sw	$fp,28($sp)
	sw	$28,24($sp)
	move	$fp,$sp
	la	$4,__sF
	la	$25,invert_file
	jal	$31,$25
	move	$sp,$fp
	lw	$31,32($sp)
	lw	$fp,28($sp)
	addu	$sp,$sp,40
	j	$31
	.end	stdin_inverter
	.size	stdin_inverter, .-stdin_inverter

	.comm	opt,4
	.ident	"GCC: (GNU) 3.3.3 (NetBSD nb3 20040520)"
